package org.ezjava.rpc.dubbo.provider;

import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.ezjava.rpc.dubbo.provider.rpc.TFServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext;

/**
 * @author Erik
 * @create 2021-08-06 15:23
 * @description
 **/
@SpringBootApplication
@EnableDubbo
@DubboComponentScan(value = "org.ezjava.rpc.dubbo.provider.dubbo")
@ServletComponentScan(value = "org.ezjava.rpc.dubbo.provider.listener")
public class Application {
    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(Application.class, args);
        // 这种方案不好，可以通过事件异步进行加载处理
     /*   try {
            TFServer thriftServer = ctx.getBean(TFServer.class);
            thriftServer.startServer();
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }

}
